import { createStore }from 'vuex'



// 直接引入所有的模块
const modulesFiles = import.meta.globEager('./modules/**/*.js')
const modules = {}
for (const key in modulesFiles) {
  modules[key.replace(/(\.\/modules\/|\.js)/g, '')] = modulesFiles[key].default
}

Object.keys(modules).forEach(item => {
  modules[item]['namespaced'] = true
})


const store = createStore({
    state:{},
    mutations:{},
    actions:{},
    getters:{},
    modules
})

export default store